function displayPar()
{
	$("#xslPar").delay(500).fadeIn();
}

function displayTextArea()
{
	$("#xslDiv").fadeIn();
	$("#xslPar").delay(200).fadeOut();
}

function loadXMLDoc(fname) { 
	if (window.XMLHttpRequest)
	  {
	  xhttp=new XMLHttpRequest();
	  }
	else
	  {
	  xhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	xhttp.open("GET",fname,false);
	xhttp.send("");
	return xhttp.responseXML;
} 

function displayResultWithPath(path) {
	displayResultInner(path);
}

function displayResult(style) {
	displayResultInner("student/xsl/"+style+".xsl");
}

function displayResultInner(path) {
    var xml=loadXMLDoc("student/myTimeTable.jsp");
    var xsl=loadXMLDoc(path);
    // code for IE
    if (window.ActiveXObject) {
        ex=xml.transformNode(xsl);
        document.getElementById("timetableBody").innerHTML=ex;
    }
    // code for Mozilla, Firefox, Opera, etc.
	else if (document.implementation && document.implementation.createDocument)
	{
		xsltProcessor=new XSLTProcessor();
		xsltProcessor.importStylesheet(xsl);
		resultDocument = xsltProcessor.transformToFragment(xml,document);
		var innerBody = document.getElementById("timetableBody-inner");
		innerBody.innerHTML = '';
		innerBody.appendChild(resultDocument);
	}
}
